package com.example.jdimust.main.ui.Expandfunctions;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;

import com.example.jdimust.util.ACache;
import com.example.jdimust.totalbase.DataStatisticsActivity;
import com.example.jdimust.R;
import com.example.jdimust.register.RegisterActivity;

public class ExpandfunctionsFragment extends Fragment {



    public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View root = inflater.inflate(R.layout.fragment_notifications, container, false);
        Button bt_data = (Button) root.findViewById(R.id.sjtj);
//        Button bt_heyue = (Button) root.findViewById(R.id.znhy);
        Button bt_regis = (Button) root.findViewById(R.id.bt_register111);
        bt_regis.setVisibility(View.GONE);
        bt_data.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getContext(), DataStatisticsActivity.class);
                startActivity(intent);
            }
        });
        ACache acache=ACache.get(getContext());//创建ACache组件
        if (Integer.valueOf(acache.getAsString("acaregisterUser")).intValue() == 1){
            bt_regis.setVisibility(View.VISIBLE);
        }
        bt_regis.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getContext(), RegisterActivity.class);
                startActivity(intent);
            }
        });

        return root;
    }

}

